package com.ruibang.glass.produce.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.teaming.cloud.framework2.common.pojo.BaseEntity;
import com.teaming.cloud.framework2.common.tools.LocalDateTimeStringConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-03-11  10:37
 * @Description: TODO:生产-配料-料罐装货记录实体
 * @Version: 1.0
 */

@Data
@ApiModel
@TableName(value = "g_produce_bucket_shipment_record")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER, verticalAlignment = VerticalAlignmentEnum.CENTER)
public class BucketShipmentRecord extends BaseEntity {
    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ExcelIgnore
    private String id;

    @ApiModelProperty("容器")
    @NotBlank(message = "容器不可为空")
    @ColumnWidth(10)
    @ExcelProperty(value = {"容器"}, index = 0)
    private String container;

    @ApiModelProperty("物料")
    @NotBlank(message = "物料不可为空")
    @ColumnWidth(10)
    @ExcelProperty(value = {"物料"}, index = 1)
    private String material;

    @ApiModelProperty("数量")
    @NotNull(message = "数量不可为空")
    @ColumnWidth(10)
    @ExcelProperty(value = {"数量"}, index = 2)
    private Integer num;

    @ApiModelProperty("装载时间")
    @NotNull(message = "装载时间不可为空")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(18)
    @ExcelProperty(value = {"装载时间"}, index = 3, converter = LocalDateTimeStringConverter.class)
    private LocalDateTime loadTime;

    @ApiModelProperty("卸载时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ColumnWidth(18)
    @ExcelProperty(value = {"卸载时间"}, index = 4, converter = LocalDateTimeStringConverter.class)
    private LocalDateTime unloadTime;

    @ApiModelProperty("装载操作人")
    @ColumnWidth(10)
    @ExcelProperty(value = {"装载操作人"}, index = 5)
    private String loadOperator;

    @ApiModelProperty("卸载操作人")
    @ColumnWidth(10)
    @ExcelProperty(value = {"卸载操作人"}, index = 6)
    private String unloadOperator;

    @ApiModelProperty("装载操作人用户ID")
    @ExcelIgnore
    private String loadOperatorId;

    @ApiModelProperty("卸载操作人用户ID")
    @ExcelIgnore
    private String unloadOperatorId;

    @ApiModelProperty("装货库位")
    @NotBlank(message = "装货库位不可为空")
    @ColumnWidth(10)
    @ExcelProperty(value = {"装货库位"}, index = 7)
    private String loadWarehousePosition;

    @ApiModelProperty("卸货库位")
    @ColumnWidth(10)
    @ExcelProperty(value = {"卸货库位"}, index = 8)
    private String unloadWarehousePosition;

    @ApiModelProperty("异常卸货 0：否 1：是")
    @NotBlank(message = "异常卸货状态不可为空")
    @ColumnWidth(10)
    @ExcelProperty(value = {"异常卸货"}, index = 9)
    private String abnormalStatus;

    @ApiModelProperty("异常原因")
    @ColumnWidth(10)
    @ExcelProperty(value = {"异常原因"}, index = 10)
    private String abnormalCause;

    @ApiModelProperty("是否删除：1：是 0：否")
    @ExcelIgnore
    @TableLogic
    private String isDelete;

    @ApiModelProperty(value = "配方编号")
    private String formulaCode;

}
